# -*- coding: utf-8 -*-
"""
Created on Fri Mar  4 16:58:13 2022
@author: 29165
"""
#<li title="2" class="ant-pagination-item ant-pagination-item-2 ant-pagination-item-active" tabindex="0"><a rel="nofollow">2</a></li>
from selenium import webdriver
from selenium.webdriver.common.by import By
driver=webdriver.Edge()
driver.get('https://www.baihangcredit.com/main/news')
element=driver.find_element(by=By.CLASS_NAME,value='ant-select-arrow')
webdriver.ActionChains(driver).move_to_element(element ).click(element ).perform()
flex=element.find_element(by=By.XPATH,value='//*[@id="root"]/div/div[2]/div[2]/div/div[2]/ul/li[10]/div/div[2]/div/div/div/div[2]/div/div/div/div[3]')
webdriver.ActionChains(driver).move_to_element(flex).click(flex).perform()
body=driver.find_element(by=By.CLASS_NAME,value='ant-list-items')
links=body.find_elements(by=By.TAG_NAME,value='a')
for link in links:
    print(link.text,sep=' ',end='\n')
for i in range(10):
    body=driver.find_element(by=By.CLASS_NAME,value='ant-list-items')
    links=body.find_elements(by=By.TAG_NAME,value='a')
    for link in links:
        print(link.text,sep=' ',end='\n')
    page_turn=driver.find_element(by=By.CLASS_NAME,value="ant-pagination-next")
    webdriver.ActionChains(driver).move_to_element(page_turn).click(page_turn).perform()